<?php
ob_start();
if(isset($_GET['lang']))
	{
		$lang = $_GET['lang'];
		$_SESSION['lang'] = $lang;
		setcookie("LocaleCookie", $lang, time()+3600*7);
	}
	else
	{
		//default load cookie if available
		if(isset($_COOKIE['LocaleCookie']))
		{
			$_SESSION['lang'] = $_COOKIE['LocaleCookie'];			
		}
		else
		{
			//default language is vietnamese
			$_SESSION['lang']  = "vni";
		}
		
	}
	
	if($_SESSION['lang']=="eng")
	{
		require_once "def_lang-en.php";
	}
	else
	{
		require_once "def_lang-vi.php";
	}
ob_flush();
?>